package com.service;

import com.dao.UserDAO;
import com.model.User;

public class UserService {
	private UserDAO userDAO;
	
	public UserService() {
	}
	
	public UserService(UserDAO userDAO) {
		this.userDAO = userDAO;
	}
	
	public UserService(UserDAO userDAO, boolean injected) {
		if (injected) {
			this.userDAO = userDAO;
		}
	}
	
	public UserDAO getUserDAO() {
		return userDAO;
	}

	public void setUserDAO(UserDAO userDAO) {
		this.userDAO = userDAO;
	}

	public void add(User u) {
		this.userDAO.save(u);
	}
}
